var BulletA = Bullet.extend({
    _scope : 0,
    _collide : false,
    ///////////////////////////////////////////////////////////
    ctor : function(filename,power,speed,type){
        this._super(filename,power,speed,type);
    },
    onEnter:function () {
        this._super();
    },
    onExit : function(){
        this._super();
    },
    ////////////////////////// settings ////////////////////////
    revive : function(range){
        this.setLife(true);
        this._collide = false;
        this.setScale(1);
        this._scope = range;
        this.setOpacity(255);
    },
    recover : function(opc){
        this.setLife(false);
        this._collide = true;
        this.setOpacity(opc);
        this.setScale(1);
    },
    enableParentFire : function(){
        this.getUserObject().enableFire();
    },
    //////////////////////moving///////////////////////
    moving : function(dt){
        if ( this._life ){
            var step = 255/this._speed;
            var opc = this.getOpacity()-step;
            var scl = this.getScale()+(this._scope/60)/this._speed;
            if( opc<=100 ){
                opc = 0;
                this.recover(opc);
                this.enableParentFire();
            }else{
                this.setScale(scl);
                this.setOpacity(opc);
            }
        }
    },
    collideRect:function (x, y) {
        var width=30,height=30;
        return cc.rect(x-width*0.5, y-height*0.5, width, height);
    }
});


